extends layout

block content
    h2.page-header
        = category.name
        &nbsp;分类下的所有文章&nbsp;
        = posts.length
        
    each post in posts
        div.post
            h3.post-title
                a(href="/posts/view/" + post._id, target="_blank")
                    =post.title
            div.post-abstract
                =truncate(post.content, 160)
            div.post-meta
                span.post-created
                    时间:&nbsp;
                    =moment(post.created).format('YYYY-MM-DD')
                span.post-author
                    作者:&nbsp;
                    =post.author.name
                span.post-category
                    分类:&nbsp;
                    a(href="/posts/category/" + post.category.name, target="_blank")
                        =post.category.name
                span.post-comment
                    评论:&nbsp;
                    =post.comments.length || 0
                span.post-favorite
                    被赞:&nbsp;
                    =post.meta.favorite || 0
                span.post-link
                    a(href="/posts/view/" + post._id, target="_blank") 查看全文





